import { createRouter, createWebHashHistory, RouteLocationNormalized, NavigationGuardNext } from 'vue-router'

import routes from './routes'

const VITE_BASE_URL = import.meta.env.VITE_BASE_URL

const router = createRouter({
  history: createWebHashHistory(VITE_BASE_URL as string),
  strict: true,
  routes,
})

router.beforeEach(async (to: RouteLocationNormalized, _, next: NavigationGuardNext) => {
  next()
})

router.afterEach(() => {})

export default router
